package cn.gcc.learningTime.controller;

import cn.gcc.learningTime.dao.ItemMapper;
import cn.gcc.learningTime.entity.Item;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 你皓哥靓号
 * @version 1.0
 * @title learningTime
 * @description //TODO 学时
 * @date 2020/11/18 20:20 星期三
 */

@RestController
public class ItemController {
    @Autowired
    private ItemMapper itemMapper;
//  学时统计
    @GetMapping("credit/items")
    public List<Item> getItem(){
        List<Item> items=itemMapper.getAll();
//        List<Item> items=new ArrayList<>();
//        for(int i=1;i<=20;i++){
//            Item item=new Item();
//            item.setCredit(i);
//            items.add(item);
//        }
        return items;
    }
}
